﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AntiObesity.Base;
using AntiObesity.Base.Managers;

namespace AntiObesity.Services
{
    public partial class ChangePassword : SecuredPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            DataBind();
        }

        protected void btnChange_Click(object sender, EventArgs e)
        {
            // TODO: server side validation
            var user = Session.GetCurrentUser();
            user.Password = txtPassword.Text;
            UserManager.Persist(user);

            Response.Redirect("UserHome.aspx");
        }
    }
}
